package com.ddstation.instrument_disinfect.constant;

import org.apache.commons.lang3.StringUtils;

public enum UltravioletOperationTypeEnum {
    INSERT(1,"新增设备"), UPDATE(2, "更换设备"), DELETE(3, "移除设备");

    private Integer value;
    private String desc;

    private UltravioletOperationTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static UltravioletOperationTypeEnum val(Integer value) {
        if (null == value) {
            return null;
        }
        for (UltravioletOperationTypeEnum opEnum: values()) {
            if (opEnum.getValue().equals(value)) {
                return opEnum;
            }
        }
        return null;
    }

    public static UltravioletOperationTypeEnum val(String desc) {
        if (StringUtils.isEmpty(desc)) {
            return null;
        }
        for (UltravioletOperationTypeEnum opEnum: values()) {
            if (opEnum.getDesc().equals(desc)) {
                return opEnum;
            }
        }
        return null;
    }
}
